/*
 * Copyright rgil2010
 * All rights reserved
 */

package com.test.gui.swing.components.panel;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 *
 * @author user
 */
public class lbzHrzTextField2 extends JPanel{

 public lbzHrzTextField2(String strTextRight, String strTextLeft, int length){

        initializeComponents(strTextRight, strTextLeft, length);

    }
    private void initializeComponents(String strTextRight, String strTextLeft, int length)
    {
        lblChampLeft = new JLabel();
        lblChampRight = new JLabel();
        txfChampLeft = new JTextField();
        txfChampRight = new JTextField();


        lblChampLeft.setText(strTextRight + " :");
        lblChampRight.setText(strTextLeft + " :");


        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(lblChampLeft)
                .addGap(length, length, length)
                .addComponent(txfChampLeft)
                .addComponent(lblChampRight)
                .addGap(length, length, length)
                .addComponent(txfChampRight)
            )
        );

        layout.setVerticalGroup(
         layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblChampLeft)
                        .addComponent(txfChampLeft)
                        .addComponent(lblChampRight)
                        .addComponent(txfChampRight)
                     )
                )
        );
    }

    public String getTextLeft(){
        return txfChampLeft.getText();
    }
    public String getTextRight(){
        return txfChampRight.getText();
    }
    private JLabel lblChampLeft;
    private JLabel lblChampRight;
    private JTextField txfChampLeft;
    private JTextField txfChampRight;
}
